<div class="pagination clrfix">
	<ul>
    	<li><a href="?action=<?php echo $action;?>&page=1">首页</a></li>
    	<li><a href="<?php if(1 >= $curpage){?>?action=<?php echo $action;?>&page=1<?php }else{?>?action=<?php echo $action;?>&page=<?php echo ($curpage-1);}?>">上一页</a></li>
    <?php
    	for($i=1;$i<=$totalpage;$i++)
        {
        	echo '<li class="num"><a href="?action='.$action.'&page='.$i.'"';
            if($i == $curpage){
            	echo 'class="on"';
            }
            echo ' >'.$i.'</a></li>';
        }
    ?>
    	<li><a href="<?php if(($curpage+1) > $totalpage){?>?action=<?php echo $action;?>&page=<?php echo $totalpage;}else{?>?action=<?php echo $action;?>&page=<?php echo ($curpage+1);}?>">下一页</a></li>
    	<li><a href="?action=<?php echo $action;?>&page=<?php echo $totalpage;?>">尾页</a></li>
    </ul>
</div>